﻿<template>
    <div id="app">

        <mt-header v-bind:title="title" style="background-color:#fda10e">
        
            <a slot="left" @click="back()">返回</a>

        </mt-header>

        <div class="mui-card">
            <div class="mui-card-header">{{info.title}}</div>
            <div class="mui-card-content">
               
                <div class="mui-card-content-inner">
                  {{info.desc}}
                </div>
            </div>
            <div class="mui-card-footer">发送人:{{info.sendusername}}<span>日期:{{info.createtime}}</span></div>
        </div>
    </div>
</template>

<script>
    import Bus from '../bus.js'
    export default {
        name: 'app',
        data() {
            return {
                title: "系统消息",
                info: {},
                html:""
            } 
        },
        mounted() {
             
           
            window.history.pushState('forward', null, '#');
            window.history.forward(1);
            window.onpopstate = () => {
                Bus.$emit('val', "show");
                this.$router.go(-1);
            }
        },
        methods:
        {
           
            load: function () {
                var id = this.$route.params.id;
                console.log(this.$route.params);
                var _this = this;
                this.$api.post('wx/Index/getmessageinfo', {
                    "id": id
                }, response => {
                    if (response.status >= 200 && response.status < 300) {
                        console.log(response.data);
                        var data = response.data;
                        if (data.status == 200) {
                            _this.$data.info = data.data;
                         
                        }

                        //请求成功，response为成功信息参数
                    } else {
                        console.log(response.message);
                        //请求失败，response为失败信息
                    }
                });
            },
            back: function () {
               
           
                Bus.$emit('val', "show")
                this.$router.go(-1);
            }
        },
        created: function () {
            this.load();

        }
    }
</script>

<style scoped>
</style>